<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
</head>
<body bgcolor="white">

	<h2>The JAVA library which reconciles JDBC and POJO</h2>

	<p>Start working with POJO without rewriting all your JDBC
		application. Without any configuration file, without any annotation,
		use your native SQL request with JDBC and get POJO(s).</p>

	<h2>Sample code</h2>
	<p>Firstable, you have to create a ConnectionManager. A
		ConnectionManager is not a connection pool. Taking a JDBC URL or a
		datasource, the ConnectionManager just provide new connection.</p>
	<pre>
 JDBCConnection connectionManager = new JDBCConnection();
 connectionManager.setDriver(&quot;com.mysql.jdbc.Driver&quot;);
 connectionManager
 		.setUrl(&quot;jdbc:mysql://localhost:3306/dbName?autoReconnect=true&quot;);
 connectionManager.setUsername("user");
 connectionManager.setPassword("pass");
 </pre>
	<p>Now we can start working with our database. Pojodbc take care of
		the database connection. The following code shows how to obtain a list
		of Pojo.</p>
	<pre>
 Transaction transaction = null;
 try {
    // Obtain a new transaction from the ConnectionManager
    transaction = connectionManager.getNewTransaction(false,
                              java.sql.Connection.TRANSACTION_READ_COMMITTED);
    // Start a new Query
    Query query = transaction.prepare(&quot;SELECT * FROM MyTable WHERE status=?&quot;);
    query.getStatement().setString(1, &quot;open&quot;);
    query.setFirstResult(0);
    query.setMaxResults(10);
    
    // Get the result
    List&lt;MyPojo&gt; myPojoList = query.getResultList(MyPojo.class));
    
    // do everything you need
    
  } finally {
    // Release the transaction
    if (transaction != null)
      transaction.close();
}
</pre>
	<p>The only thing you have to do is to release the transaction. The
		best way to do that is to close the transaction in a finally clause.
		Pojodbc will release all Statement, ResultSet and Connection.</p>
	<p>You dont have to maintain the transaction open to use your Pojo
		list.</p>
	<h2>License and copyright</h2>
	<p>Copyright (C) 2008-2015 OpenSearchServer Inc</p>
	<p>Licensed under the Apache License, Version 2.0 (the "License");
		you may not use this file except in compliance with the License. You
		may obtain a copy of the License at</p>
	<p>http://www.apache.org/licenses/LICENSE-2.0</p>
	<p>Unless required by applicable law or agreed to in writing,
		software distributed under the License is distributed on an "AS IS"
		BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
		implied. See the License for the specific</p>
	<p>Jaeksoft Pojodbc is free software: you can redistribute it
		and/or modify it under the terms of the GNU General Public License as
		published by the Free Software Foundation, either version 3 of the
		License, or (at your option) any later version.</p>
	<p>OpenSearchServer Pojodbc is distributed in the hope that it will
		be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
		of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
		General Public License for more details.</p>

	<h2>Related Documentation</h2>

	For overviews, tutorials, examples, guides, and tool documentation,
	please see:
	<ul>
		<li><a href="http://sourceforge.net/projects/pojodbc">The
				sourceforge project</a></li>
		<li><a href="http://pojodbc.sourceforge.net">The official
				website</a></li>
		<li><a href="http://pojodbc.sourceforge.net/public">The
				Javadoc official location</a></li>
	</ul>

</body>
</html>